import { OmitPartial } from '/#/utils';
import { BasicPageParams, BasicModel, BasicFetchResult } from '/@/api/model/baseModel';

export interface BasicDataSourceModel {
  dbinfoId: number;
  dbAlias: string;
  dbDriver: string;
  dbUrl: string;
  dbUserName: string;
  dbPassword: string;
  dbType: string;
  dbName: string;
}

export type UpdateDataSourceParams = OmitPartial<BasicDataSourceModel, 'dbinfoId'>;

export type DataSourceParams = Partial<BasicDataSourceModel>;

export type DataSourcePageSearchParams = BasicPageParams & DataSourceParams;

export type DataSourceListSearchParams = DataSourceParams;

export type DataSourceModel = BasicModel & BasicDataSourceModel;

export type DataSourcePageListGetResultModel = BasicFetchResult<DataSourceModel>;

export type DataSourceListGetResultModel = DataSourceModel[];

/**
 * 后台开启id序列化时id类型为字符串，如果没开启id类型就是number,此处用一个动态类型代替，方便生成；
 */
export type DataSourceIDType = BasicDataSourceModel['dbinfoId'];
